**************************************************
*****************Program dofile*******************
**************************************************

***Creating programs***

capture program drop dupprogram 
program define dupprogram
	duplicates tag LopNr, gen(d)
	drop if d>0
	drop d
end


capture program drop YearsEducation
program define YearsEducation													/*According to convention at IFAU*/
	gen double yearseducation = .
	replace yearseducation = 6.6  if Sun2000niva_old == "*"
	replace yearseducation = 7.5  if Sun2000niva_old == "1"
	replace yearseducation = 9.4  if Sun2000niva_old == "2"
	replace yearseducation = 11.2 if Sun2000niva_old == "3"
	replace yearseducation = 12.4 if Sun2000niva_old == "4"
	replace yearseducation = 14.2 if Sun2000niva_old == "5"
	replace yearseducation = 17   if Sun2000niva_old == "6"
	replace yearseducation = 20.4 if Sun2000niva_old == "7"
end



